

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>机器组别管理-新增</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
   <link rel="stylesheet" href="layui/css/layui.css" media="all">
  <link rel="stylesheet" href="layui/css/admin.css" media="all">
  <style>
  	.layui-tree-skin-shihuang  .layui-tree-branch{
  		display: none;
  	}
  </style>
  
</head>
<body>
<div class="layui-container">  
  <div class="layui-card">
  <div class="layui-row">
    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12" >
      <div class="layui-card-header"><span style="font-weight: bold; font-size: 22px;">新增机器组别</span></div>
    </div>
   </div>
  <div class="layui-row layui-card-body ">
    <div class="layui-col-xs4 layui-col-sm4 layui-col-md2" style="height: 500px; border: 1px solid gainsboro;">
      <ul id="tree" class="layui-tree-skin-shihuang"></ul>
    </div>
    <div class="layui-col-xs8 layui-col-sm8 layui-col-md10 ">
      <form class="layui-form" action="" style="margin-left: 50px;">

					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">组别名称：</label>
							<div class="layui-input-inline">
								<input type="text" name="machineId" lay-verify="required" autocomplete="off" class="layui-input">
							</div>
						</div>
						
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">上级组别：</label>
							<div class="layui-input-inline">
								<input type="text" name="machineId" lay-verify="required" autocomplete="off" class="layui-input" value="珠江新城">
							</div>
						</div>
						
					</div>
					<div class="layui-form-item">
						
						<div class="layui-inline">
							<label class="layui-form-label">组别状态：</label>
							<div class="layui-input-inline">
								<select>
									<option value="">请选择状态</option>
									<option selected="">正常</option>
									<option>作废</option>
									
								</select>
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						

						<div class="layui-inline" style=" margin-left:110px;">
							<button class="layui-btn  select">保存</button>

							<button class="layui-btn  layui-btn-warm reset" type="reset" id="back">返回</button>
						</div>
					</div>
				</form>
			</div>

			

		
    </div>
   </div>
  </div>
   
 

 
    
 <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
		<script src="layui/layui.js"></script>
		<script>
			layui.use(['form','tree'], function() {
				var form = layui.form;
					

                layui.tree({
    elem: '#tree' //指定元素
    ,target: '_blank' //是否新选项卡打开（比如节点返回href才有效）
    ,click: function(item){ //点击节点回调
      layer.msg('当前节名称：'+ item.name + '<br>全部参数：'+ JSON.stringify(item));
      console.log(item);
    }
    ,nodes: [ //节点
    {
        name: '全部'
        ,id: 1
        ,spread: true
        ,children: [
          {
            name: '天河区'
            ,id: 11
            ,spread: true
            ,children: [
              {
                name: '珠江新城'
                ,id: 111
                
                
              }, {
                name: '五羊新城'
                ,id: 112
              }, {
                name: '天河城'
                ,id: 113
              }
            ]
          }, 
          {
            name: '海珠区'
            ,id: 21
            ,spread: false
            ,children: [
              {
                name: '客村立交'
                ,id: 211
                
                
              }, {
                name: '万胜围'
                ,id: 212
              }
            ]
            
          },
          {
            	name: '荔湾区'
            ,id: 3
            }
        ]
      }
      
    ]
  });
				

			});
			$('#back').click(function(){
					//alert(11)
					window.location.href="machine-ground.html";
					
				});
			
		</script>
</body>
</html>
